﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApplication2
{
    /// <summary>
    /// WindowEx.xaml 实现异形窗口，可以直接拖动，关闭。 拖动的实现非常简单，this->DragMove();
    /// </summary>
    public partial class WindowEx : Window
    {
        public WindowEx()
        {
            InitializeComponent();
        }

        private void closeButtonRectangle_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void NonRectangularWindow_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }
    }
}
